﻿using Zpb;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using UtilLib;
using SvCore.Tcp;

namespace client
{
    /// <summary>
    /// PageLogin.xaml 的交互逻辑
    /// </summary>
    public partial class PageLogin : Page
    {
        public PageLogin()
        {
            InitializeComponent();
        }
        private void Button_Click_ServerConn(object sender, RoutedEventArgs e)
        {
            //App.WdMain.PageOn("PagePlayer");
            //GameData.Player = new();
            //App.PagePlayer.UpdatePage();
            //return;

            if (TextBoxAccount.TextboxText == "z")
            {
                App.WdMain.玩家登录成功();
                return;
            }

            MyTcpClient.Start();

            //if (MyTcpClient.IsConneted)
            //{
            //    App.DebugInfo("连接成功");
            //}
            //else
            //{
            //    App.DebugError("连接失败");
            //    return;
            //}
        }
        private void Button_Click_ServerLogin(object sender, RoutedEventArgs e)
        {
            C2LUserLogin req = new();
            req.Account = TextBoxAccount.TextboxText;
            //req.Account = Util.Rand(999999).ToString();
            req.Password = TextBoxPassword.TextboxText;
            App.Send(req);
        }
    }
}
